#ifndef SERIALIZABLE_DOUBLE_H
#define SERIALIZABLE_DOUBLE_H

#include "Serializable.h"

// A double which knows how to print and parse itself

class Serializable_Double : Serializable {
public:
    Serializable_Double(double v) {
        value = v;
    }

    std::ostream& print(std::ostream& os) const {
        os << value;
        return os;
    }

    bool match(Parser& parser) {
        return parser.match(value) == 1;
    }

    double value;
};

std::ostream& operator<<( std::ostream& os,
                          const Serializable_Double& v ) {
    return v.print(os);
}

#endif
